<?php

class User_model extends CI_Model {
	

	public function login($username,$password){
		$this->db->where('password',md5($password));
		$query = $this->db->get('user');
		if($query->num_rows){
			$user = $query->row();
			$this->session->set_userdata('uid',$user->id);
			$this->session->set_userdata('uname',$user->username);
			return true;
		}
		return false;
	}
}